/* ==========================================================
   AI Delivery - The Delivery Gap
   ("Why AI Programs Stall Between Pilot and Production")
   File: wwwroot/css/ai-delivery-gap.css
   Used by: Views/Partials/blocklist/Components/aiDeliveryGapBlock.cshtml
   Fluid layout: same scaling as the other blocks (6.8vw gutter).
   ========================================================== */
.ai-gap {
  --gap-navy: #14256b;
  --gap-orange: #ff9a45;
  --gap-peach: #fdf1e7;
  --gap-item: #f8f8f9;
  --gap-grey: #6b7080;
  --gap-gutter: 6.8vw;
  --gap-ease: cubic-bezier(.65, 0, .35, 1);
  --gap-ease-out: cubic-bezier(.16, 1, .3, 1);

  box-sizing: border-box;
  width: 100%;
  background: #fff;
  padding: clamp(48px, 5.6vw, 144px) var(--gap-gutter);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--gap-navy);
  -webkit-font-smoothing: antialiased;
}
.ai-gap *, .ai-gap *::before, .ai-gap *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ---------- Heading ---------- */
.ai-gap__eyebrow {
  margin-bottom: clamp(10px, .9vw, 24px);
  font-size: clamp(11px, .78vw, 20px);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gap-navy);
}
.ai-gap__heading {
  margin-bottom: clamp(24px, 2.2vw, 56px);
  font-size: clamp(24px, 2.08vw, 54px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--gap-navy);
}

/* ---------- Stat card ---------- */
.ai-gap__stat {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.8vw, 72px);
  padding: clamp(24px, 2.4vw, 62px) clamp(22px, 2.8vw, 72px);
  background: var(--gap-peach);
}
.ai-gap__stat-num {
  flex: none;
  min-width: 3.4em;                     /* no width jump during the count-up */
  font-size: clamp(40px, 4.6vw, 118px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  color: var(--gap-navy);
}
.ai-gap__stat-text {
  font-size: clamp(14px, 1.04vw, 27px);
  font-weight: 600;
  line-height: 1.55;
  color: var(--gap-navy);
}
.ai-gap__stat-source {
  margin-top: clamp(10px, .9vw, 24px);
  font-family: "DM Sans", "Poppins", sans-serif;
  font-size: clamp(11px, .72vw, 19px);
  line-height: 1.5;
  color: var(--gap-grey);
}

/* ---------- Intro ---------- */
.ai-gap__intro {
  margin: clamp(24px, 2.4vw, 62px) 0 clamp(18px, 1.7vw, 44px);
  font-family: "DM Sans", "Poppins", sans-serif;
  font-size: clamp(14px, .9vw, 23px);
  line-height: 1.6;
  color: var(--gap-navy);
}

/* ---------- Accordion list ---------- */
.ai-gap__list {
  display: grid;
  gap: clamp(12px, 1.1vw, 28px);
  list-style: none;
}
.ai-gap__item {
  position: relative;
  background: var(--gap-item);
}
/* orange top line */
.ai-gap__item::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gap-orange);
  transform-origin: left center;
}
.ai-gap__toggle {
  display: grid;
  grid-template-columns: clamp(28px, 2.4vw, 62px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 1vw, 26px);
  width: 100%;
  padding: clamp(16px, 1.5vw, 38px) clamp(18px, 1.9vw, 48px) clamp(10px, .9vw, 24px);
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: padding .6s var(--gap-ease);
}
.ai-gap__item:not(.is-open) .ai-gap__toggle { padding-bottom: clamp(16px, 1.5vw, 38px); }
.ai-gap__toggle:focus-visible { outline: 2px solid var(--gap-orange); outline-offset: 3px; }

.ai-gap__num {
  font-size: clamp(14px, 1.04vw, 27px);
  font-weight: 600;
  color: var(--gap-navy);
}
.ai-gap__title {
  font-size: clamp(15px, 1.15vw, 30px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--gap-navy);
}

/* orange circle with − / + */
.ai-gap__icon {
  position: relative;
  display: block;
  width: clamp(26px, 1.8vw, 46px);
  height: clamp(26px, 1.8vw, 46px);
  border-radius: 50%;
  background: var(--gap-orange);
  transition: transform .5s var(--gap-ease-out), box-shadow .4s ease;
}
.ai-gap__icon i {
  position: absolute;
  top: 50%; left: 50%;
  width: 42%;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transform: translate(-50%, -50%);
  transition: transform .5s var(--gap-ease), opacity .4s ease;
}
.ai-gap__icon i:last-child { transform: translate(-50%, -50%) rotate(90deg); }
.ai-gap__item.is-open .ai-gap__icon i:last-child { transform: translate(-50%, -50%) rotate(0deg); opacity: 0; }
.ai-gap__toggle:hover .ai-gap__icon { transform: scale(1.08); box-shadow: 0 6px 16px rgba(255, 154, 69, .35); }

/* smooth open/close (grid-rows trick) */
.ai-gap__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .6s var(--gap-ease);
}
.ai-gap__item.is-open .ai-gap__panel { grid-template-rows: 1fr; }
.ai-gap__panel > div { overflow: hidden; }
.ai-gap__text {
  padding: 0 calc(clamp(18px, 1.9vw, 48px) + clamp(26px, 1.8vw, 46px) + clamp(10px, 1vw, 26px))
           clamp(18px, 1.6vw, 42px)
           calc(clamp(18px, 1.9vw, 48px) + clamp(28px, 2.4vw, 62px) + clamp(10px, 1vw, 26px));
  font-family: "DM Sans", "Poppins", sans-serif;
  font-size: clamp(13px, .9vw, 23px);
  line-height: 1.65;
  color: #3a4160;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .3s ease, transform .4s ease;
}
.ai-gap__item.is-open .ai-gap__text {
  opacity: 1;
  transform: none;
  transition: opacity .55s ease .15s, transform .7s var(--gap-ease-out) .15s;
}

/* ---------- Entrance (added by JS only, so content is visible without it) ---------- */
.ai-gap.js-reveal .ai-gap__fx {
  opacity: 0;
  transform: translateY(24px);
}
.ai-gap.js-reveal .ai-gap__item::before { transform: scaleX(0); }
.ai-gap.js-reveal.is-visible .ai-gap__fx {
  opacity: 1;
  transform: none;
  transition: opacity .9s ease var(--fd, 0s), transform 1.1s var(--gap-ease-out) var(--fd, 0s);
}
.ai-gap.js-reveal.is-visible .ai-gap__item::before {
  transform: scaleX(1);
  transition: transform 1.2s var(--gap-ease) calc(var(--fd, 0s) + .25s);
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) { .ai-gap { --gap-gutter: 32px; } }
@media (max-width: 900px)  { .ai-gap { --gap-gutter: 24px; } }
@media (max-width: 560px) {
  .ai-gap { --gap-gutter: 20px; }
  .ai-gap__stat { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ai-gap__stat-num { min-width: 0; }
  .ai-gap__toggle { grid-template-columns: 26px minmax(0, 1fr) auto; padding-left: 16px; padding-right: 16px; }
  .ai-gap__text { padding: 0 16px 18px calc(16px + 26px + 10px); }
}

@media (prefers-reduced-motion: reduce) {
  .ai-gap *, .ai-gap *::before { transition: none !important; }
}